<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
  <title>求职者信息管理</title>
  <link href="/js/bstable/css/bootstrap.min.css" rel="stylesheet" type="text/css">
  <link href="/js/bstable/css/bootstrap-table.css" rel="stylesheet" type="text/css">
  <link href="/css/table.css" rel="stylesheet" type="text/css">

  <script src="/js/vue.js"></script>
  <script src="/js/axios.min.js"></script>
</head>
<body style="background-color: #ecf0f5;font-family: 微软雅黑;color: #475059;min-width: 1000px;overflow: auto">
<div id="app">
<!--  <div  class="notice_main">-->
<!--    <table id="table" class="table_style" style="margin: 0 auto" > </table>-->
<!--  </div>-->
  <script src="/js/jquery/jQuery-2.2.0.min.js"></script>
  <script src="/js/bstable/js/bootstrap.min.js"></script>
  <script src="/js/bstable/js/bootstrap-table.js"></script>
  <script src="/js/bstable/js/bootstrap-table-zh-CN.min.js"></script>
  <script src="/js/layer_v2.1/layer/layer.js"></script>

  <table class="table table-bordered  table-hover">
    <div class="notice_check">
      <div class="btn-group l_left" style="margin-right: 4px">
          <select v-model="state_id" class="form-control" name="state_id">
              <option value="0">---请选择---</option>
              <option v-for="select in state"  v-bind:value="select.state_id" >
                  {{select.state}}
              </option>
          </select>
      </div>
        <div class="l_left">
            <input type="text"  v-model="name" name="positionName" class="form-control" placeholder="请输入发布公司名称">
        </div>
        <button type="button" @click="queryPosition" class="btn btn-primary">查询</button>

<!--      <div class="notice_nav r_right">-->
<!--        <a class="btn btn-default" onclick="addRole()"><span class="glyphicon glyphicon-plus"></span>新增</a>-->
<!--        <a class="btn btn-default"><span class="glyphicon glyphicon-remove"></span>删除</a>-->
<!--        <a class="btn btn-default" onclick="addRole()"><span class="glyphicon glyphicon-pencil"></span>编辑</a>-->
<!--      </div>-->
    </div>
    <tr>
      <th type="radio">▢</th>
      <th>编号</th>
<!--      <th>公司ID</th>-->
        <th>公司名称</th>
      <th>行业领域</th>
<!--      <th>职位ID</th>-->
      <th>职位</th>
      <th>职位类型</th>
      <th>薪资</th>
      <th>经验要求</th>
      <th>学历要求</th>
<!--      <th width="275">岗位职责</th>-->
      <th>工作区域(线上/线下)</th>
      <th>工作时间</th>
      <th>创建日期</th>
        <th>状态</th>
      <th>操作</th>
    </tr>
    <tr v-for="(item,index) in positionList" >
    <td><label>
     <input type="checkbox"   id="inlinecheckbox1" value="true">
      </label></td>
      <td> {{index+1}} </td>
<!--      <td>{{item.company_id}}</td>-->
        <td>{{item.company_name}}</td>
      <td>{{item.company_type}}</td>
<!--      <td>{{item.position_id}}</td>-->
      <td>{{item.job}}</td>
      <td>{{item.job_type}}</td>
      <td>{{item.job_pay}}</td>
      <td>{{item.experience}}</td>
      <td>{{item.education}}</td>
<!--      <td>{{item.job_duties}}</td>-->
      <td>{{item.company_site}}</td>
      <td>{{item.company_time}}</td>
      <td>{{item.create_date}}</td>
        <td>{{item.position_state}}</td>
        <td> <a   @click="updatePosition1(item.position_id)">通过</a> |  <a   @click="updatePosition(item.position_id)">驳回</a> | <a    @click=" LookPosition(item.position_id)">详情</a></td>
    </tr>
  </table>
</div>
</body>
</html>
<script>
  new Vue({
    el:"#app",
    data:{
        name:'',
        state_id:0,
        state:[],
      positionList:[]
    },
    methods:{
        queryPosition:function (){
            _this = this
            //查询信息
            axios.get('/position/list',{
                params: {
                    positionName: this.name,
                    state_id:this.state_id
                }
            }).then(function (response) {
                _this.positionList=response.data;
                console.log(response.data);
            })
                .catch(function (error) {
                    console.log(error);
                });
        },
        updatePosition:function (position_id){
            alert("审核未通过")
            window.localStorage.setItem("sid", position_id);
            location.href="position.html"
            axios.get('/position/update',{
                params:{
                    position_id:position_id
                }
            }).then(function (response){
                console.log(response.data);
            })
                .catch(function(error){
                    console.log(error)
                });

        },
        updatePosition1:function (position_id) {
            alert("审核通过")
            window.localStorage.setItem("sid", position_id);
            location.href = "position.html"
            axios.get('/position/update1', {
                params: {
                    position_id: position_id
                }
            }).then(function (response) {
                console.log(response.data);
            })
                .catch(function (error) {
                    console.log(error)
                });
        },
        LookPosition:function (position_id){
            //alert(stuid)
            window.localStorage.setItem("position_id",position_id);
            location.href="lookPosition.html"
        },
    },

    mounted() {
        _this = this
        //查询学生信息
        axios.get('/position/list',{
            params: {
                positionName: this.name,
                state_id:this.state_id
            }
        }).then(function (response) {
            _this.positionList=response.data;
            console.log(response.data);
        })
            .catch(function (error) {
                console.log(error);
            });

        //查询状态信息
        axios.get('/state/list')
            .then(function (response) {
                _this.state = response.data
                console.log(_this.state);
            })
            .catch(function (error) {
                console.log(error);
            });
    }
  })
</script>